﻿using System.Linq.Expressions;

namespace GuanYijia.Repository
{
    public interface IBaseRepository<T> where T : class
    {
        Task<int> DeletedAsync(T enity);
        Task<int> DelRanageAsync(Expression<Func<T, bool>> expression);
        Task<int> DelRanageAsync(T entity);
        Task<int> DeltedByIdAsync(int Id);
        Task<List<T>> GetAllAsync();
        Task<IList<T>> GetAllAsync(Expression<Func<T, bool>> exception);
        Task<List<T>> GetAllAsync(Func<IQueryable<T>, IQueryable<T>> queryModifier);
        Task<List<T>> GetAllAsyncList(Expression<Func<T, bool>> exception);
        Task<T> GetAsync(Expression<Func<T, bool>> expression);
        Task<T> GetAsync(int Id);
        IQueryable<T> GetQueryable(bool tracking = true);
        IQueryable<T> GetQueryable1(string tableName, bool tracking = true);
        Task<int> InsertAsync(T entity);
        Task<int> InsertRangeAsync(List<T> entity);
        Task<int> UpdateAsync(T eneity);
        Task<int> UpdateRangeAsync(List<T> entity);
    }
}